package cn.rui.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.rui.common.ResponseBean;
import cn.rui.service.GroupNoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 徽州大都督
 * @date 2021/6/17
 */
@RestController
@RequestMapping("group")
@Api(tags = "群公告模块")
public class GroupNoticeController {

    @Autowired
    private GroupNoticeService groupNoticeService;

    @GetMapping("queryContent")
    @SaCheckLogin
    @ApiOperation(value = "获取群公告内容")
    public ResponseBean queryContent(){
        return groupNoticeService.queryContent();
    }

    @PutMapping("updateGroupContent/{contents}")
    @SaCheckLogin
    @ApiOperation(value = "修改群公告")
    public ResponseBean updateGroupContent(@PathVariable("contents")String contents){
        return groupNoticeService.updateGroupContent(contents);
    }

}
